<template>
  <basic-container shadow="never">
    <el-container>
      <el-aside width="300px">
        <basic-container>
          <start-dict-tree ref="startDictTree"
                           dict-code="procFunDefCategory"
                           @node-click="selectFunCategory"></start-dict-tree>
        </basic-container>
      </el-aside>
      <el-main>
        <basic-container>
          <avue-crud
              v-if="tableOption"
              v-bind="bindVal"
              v-on="onEvent"
              v-model:page="page"
              v-model="startForm">
          </avue-crud>
        </basic-container>
      </el-main>
    </el-container>
  </basic-container>

</template>
<script>
import StartDictTree from "components/start-components/startDictTree/index.vue";
import {createDynamicMixin} from "@/mixins/startCrud";

const optionConfig = {
  name: "start/activiti/actFunDef",
  permissionBtnHandler: {}
}
optionConfig.permissionBtnHandler = {
  // editBtn:(vm,row,defaultValue) => {
  //   console.log(row)
  // },
  delBtn: (vm, row, defaultValue) => {
    return row.sysFlag
  }
}

export default {
  name: "index",
  components: {StartDictTree},
  mixins: [createDynamicMixin(optionConfig)],
  data() {
    return {
      selectFunCategoryCode: null,
    }
  },
  created() {

  },
  methods: {
    searchReRestBefore() {
      this.selectFunCategoryCode = null
      this.$refs.startDictTree.clearCurrentNode()
    },
    beforeLoadDataSource(search) {
      if (this.selectFunCategoryCode && this.selectFunCategoryCode.length > 0) {
        search.start_search_funCategoryCode = this.selectFunCategoryCode;
      }
    },
    selectFunCategory(node) {
      this.selectFunCategoryCode = node.dictVal
      this.restLoadList();
    }
  }
}
</script>
<style scoped>

</style>